<?php
// +----------------------------------------------------------------------
// | OneKeyAdmin [ Believe that you can do better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://onekeyadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: MUKE <513038996@qq.com>
// +----------------------------------------------------------------------
namespace plugins\blog\api\validate;

use think\Validate;

class UserBlog extends Validate
{
    protected $rule = [
        'id'            => 'require|number',
        'page'          => 'require|number',
        'content'       => 'require|max:65535',
        'title'         => 'require|max:255',
    ];
    protected $message  =   [
        'id.require'        => '编号不能为空',
        'id.number'         => '编号类型错误',
        'page.require'      => '分页不能为空',
        'page.number'       => '分页类型错误',
        'content.require'   => '内容不能为空',
        'content.max'       => '内容不能超过65535个字符',
        'title.require'     => '标题不能为空',
        'title.max'         => '标题不能超过255个字符',
    ];
    protected $scene = [
        'index'         => ['page'],
        'save'          => ['content','title'],
        'update'        => ['content','title'],
        'delete'        => ['id'],
    ];
}